home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 6
/
CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso
/
cucd
/
readers
/
utils
/
cinterpreter
/
examples
/
loop2.c
< prev
Wrap
C/C++ Source or Header
|
1994-07-01
|
369b
|
25 lines
/* The loop statements. */
main()
{
int a;
char ch;
/* the while */
puts("Enter a number: ");
a = getnum();
while(a) {
print(a);
print(a*a);
puts("");
a = a - 1;
}
/* the do-while */
puts("enter characters, 'q' to quit");
do {
ch = getchar();
} while(ch!='q');
/* the for */
for(a=0; a<10; a = a + 1) {
print(a);
}
}